{
  "name": "Case 19 – Scholarship Eligibility Assessment",
  "nodes": [
    {
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2,
      "position": [0, 0],
      "parameters": {
        "formTitle": "Scholarship Application Submission",
        "formDescription": "Upload academic and financial documents for scholarship evaluation",
        "formFields": {
          "values": [
            { "fieldLabel": "Student Name", "requiredField": true },
            { "fieldLabel": "Email id", "fieldType": "email", "requiredField": true },
            {
              "fieldLabel": "Scholarship_Documents",
              "fieldType": "file",
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        }
      }
    },
    {
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [220, 0],
      "parameters": {
        "inputDataFieldName": "Scholarship_Documents",
        "name": "={{ $json['Student Name'] + '_Scholarship_Application' }}",
        "folderId": "REPLACE_WITH_SCHOLARSHIP_APPLICATIONS_FOLDER_ID"
      }
    },
    {
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [420, 0],
      "parameters": {
        "operation": "download",
        "fileId": "={{ $json.id }}"
      }
    },
    {
      "name": "Extract Scholarship Documents",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [620, 0],
      "parameters": {
        "operation": "pdf"
      }
    },
    {
      "name": "Download Scholarship Rules & Eligibility Criteria",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [820, 0],
      "parameters": {
        "operation": "download",
        "fileId": "REPLACE_WITH_SCHOLARSHIP_RULES_FILE_ID"
      }
    },
    {
      "name": "Extract Scholarship Rules",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [1020, 0],
      "parameters": {
        "operation": "pdf"
      }
    },
    {
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [220, 260],
      "parameters": {
        "promptType": "define",
        "text": "=Student Academic & Financial Documents:\n{{ $('Extract Scholarship Documents').item.json.text }}\n\nScholarship Rules & Eligibility Criteria:\n{{ $('Extract Scholarship Rules').item.json.text }}",
        "options": {
          "systemMessage": "You are a Scholarship Selection Committee Member.\n\nYOUR OBJECTIVE:\nAllocate limited scholarship funds to students who demonstrate strong academic merit and genuine financial need, in accordance with published scholarship rules and fairness principles.\n\nANALYSIS FRAMEWORK (MANDATORY):\n1. ACADEMIC MERIT – grades, academic consistency, awards, and performance relative to peers.\n2. FINANCIAL NEED – family income, dependents, existing aid, and affordability gap.\n3. ELIGIBILITY COMPLIANCE – adherence to scholarship rules, documentation completeness.\n4. EQUITY CONSIDERATIONS – socio-economic background and access to opportunity.\n5. RISK & VERIFICATION – reliability of documents and potential misrepresentation.\n\nYOU MUST PRODUCE ONE JSON OBJECT WITH EXACTLY THESE FIELDS. ALL FIELDS ARE MANDATORY.\n\nJSON SCHEMA (STRICT):\n{\n  \"Student_Name\": \"string\",\n  \"Current_Institution\": \"string\",\n  \"Program_of_Study\": \"string\",\n  \"Academic_Score_Percentage\": \"number\",\n  \"Annual_Family_Income_INR_Lacs\": \"number\",\n  \"Dependents_Count\": \"number\",\n  \"Merit_Assessment\": \"Weak | Moderate | Strong\",\n  \"Financial_Need_Level\": \"Low | Medium | High\",\n  \"Eligibility_Compliance\": \"Yes | No\",\n  \"Overall_Scholarship_Score_out_of_100\": \"number\",\n  \"Scholarship_Decision\": \"Awarded | Not Awarded\",\n  \"Committee_Remarks\": \"string\"\n}\n\nINSTRUCTIONS:\n- Numeric fields MUST contain numbers only.\n- Do NOT add, remove, or rename fields.\n- Output ONLY valid JSON.\n- IMMEDIATELY call the Google Sheets Append Row tool using this JSON."
        }
      }
    },
    {
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [0, 420],
      "parameters": {
        "model": {
          "mode": "list",
          "value": "gpt-4.1-mini"
        }
      }
    },
    {
      "name": "Append row",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4,
      "position": [420, 460],
      "parameters": {
        "operation": "append",
        "documentId": "REPLACE_WITH_GOOGLE_SHEET_ID",
        "sheetName": "Scholarship Eligibility Assessment Register"
      }
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [420, 260],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Email id'] }}",
        "subject": "Scholarship Application – Evaluation Outcome",
        "message": "={{ 'Dear ' + $('On form submission').item.json['Student Name'] + ',<br><br>Your scholarship application has been evaluated in line with the published eligibility criteria. You will be notified of the final decision and next steps shortly.<br><br>Scholarship Committee' }}"
      }
    }
  ],
  "connections": {
    "On form submission": { "main": [[{ "node": "Upload file" }]] },
    "Upload file": { "main": [[{ "node": "Download file" }]] },
    "Download file": { "main": [[{ "node": "Extract Scholarship Documents" }]] },
    "Extract Scholarship Documents": { "main": [[{ "node": "Download Scholarship Rules & Eligibility Criteria" }]] },
    "Download Scholarship Rules & Eligibility Criteria": { "main": [[{ "node": "Extract Scholarship Rules" }]] },
    "Extract Scholarship Rules": { "main": [[{ "node": "AI Agent" }]] },
    "OpenAI Chat Model": { "ai_languageModel": [[{ "node": "AI Agent" }]] },
    "Append row": { "ai_tool": [[{ "node": "AI Agent" }]] },
    "AI Agent": { "main": [[{ "node": "Send Email" }]] }
  },
  "active": false
}
